import {useState, useEffect} from 'react'

export default function useNum() {
  let [num, setNum] = useState(0)

  useEffect(() => {
    setTimeout(() => {
      setNum(++num)
    }, 2000)
  }, [])
  return [num, setNum]
}
